package com.wzh.yebServe.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author wzh
 * @create 2022/11/10 15:19
 * @Description:
 */
//@Configuration
public class WebmvcConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
//        对哪些请求进行跨域
       registry.addMapping("/**")
               .allowedOrigins("http://localhost")
               .allowCredentials(true)
               .allowedMethods("*")
               .allowedHeaders("*")
               .maxAge(3600);
    }
}
